package com.cn.dao;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;

import com.cn.entity.Taocan_xiangmu;

public class TaocanAddDao {

	
	private static SessionFactory sessionFactory;
	public SessionFactory getSessionFactory() {
		return sessionFactory;
	}
	public void setSessionFactory(SessionFactory sessionFactory) {
		this.sessionFactory = sessionFactory;
	}
	Session session;


public void add(Taocan_xiangmu tx){
	
	session=sessionFactory.openSession();
	Transaction tr=session.beginTransaction();
	session.save(tx);
	tr.commit();
	session.close();
	
	
}
}